SOGetPeerName


C Specification

#include <dolphin/socket.h>
int SOGetPeerName( int s, void* sockAddr );

Description

SOGetPeerName() gets the name of the peer connected to the specified socket.

Arguments

s The socket descriptor.
sockAddr A pointer to a socket address structure where the address of the peer connected to the specified socket is stored. The len field of the socket address must be properly initialized (e.g., sizeof(SOSockAddrIn)).

Return Values

zero Succeeded.
SO_EBADF Bad socket descriptor.
SO_EINVAL Invalid operation.
SO_ENETRESET Socket library is not initialized.
SO_ENOTCONN Not connected or has not had the peer pre-specified.

Note: Additional errors may be generated and returned in future library releases. All the negative return values must be treated as generic errors.

See Also

SOAccept(), SOConnect()